/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Entities;

import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

/**
 *
 * @author Sarah
 */
@Stateless
public class NoticeFacade extends AbstractFacade<Notice> {
    @PersistenceContext(unitName = "IServer-ejbPU")
    private EntityManager em;
    
    Notice notice;

    @Override
    protected EntityManager getEntityManager() {
        return em;
    }

    public NoticeFacade() {
        super(Notice.class);
    }
    
    public void addNotice(String sub, String text) {
        notice = new Notice();
        notice.setSub(sub);
        notice.setText(text);

        create(notice);
    }

}
